﻿using System;
using System.Runtime.Serialization;
using System.Threading;

namespace DataLayer.Model.Objects
{
    [DataContract]
    public class Skill : Action
    {
        [DataMember]
        public OccupationsOccupationSkillType SkillType;

        [DataMember]
        public int AccessLevel;


        public override string FormSlachCommand()
        {
            if (Name == null)
                Name = String.Empty;
            return string.Format("/useskill {0}", Name);
        }

        public override void DoAction()
        {
            var commandText = FormSlachCommand();
            Singleton.Terminal.SendCommand(commandText, Thread.CurrentThread.Name);
        }

        public override string ToString()
        {
            return string.Format( "Access level : {0} Name: {1}", AccessLevel, Name);
        }
    }
}
